{"ast":null,"code":"import _defineProperty from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport React, { useMemo, useContext } from 'react';\nimport { QRCodeCanvas } from 'qrcode.react';\nimport classNames from 'classnames';\nimport { ReloadOutlined } from '@ant-design/icons';\nimport { ConfigContext } from '../config-provider';\nimport LocaleReceiver from '../locale/LocaleReceiver';\nimport warning from '../_util/warning';\nimport useStyle from './style/index';\nimport Spin from '../spin';\nimport Button from '../button';\nimport theme from '../theme';\nvar useToken = theme.useToken;\nvar QRCode = function QRCode(props) {\n  var value = props.value,\n    _props$icon = props.icon,\n    icon = _props$icon === void 0 ? '' : _props$icon,\n    _props$size = props.size,\n    size = _props$size === void 0 ? 160 : _props$size,\n    _props$iconSize = props.iconSize,\n    iconSize = _props$iconSize === void 0 ? 40 : _props$iconSize,\n    _props$color = props.color,\n    color = _props$color === void 0 ? '#000' : _props$color,\n    _props$errorLevel = props.errorLevel,\n    errorLevel = _props$errorLevel === void 0 ? 'M' : _props$errorLevel,\n    _props$status = props.status,\n    status = _props$status === void 0 ? 'active' : _props$status,\n    _props$bordered = props.bordered,\n    bordered = _props$bordered === void 0 ? true : _props$bordered,\n    onRefresh = props.onRefresh,\n    style = props.style,\n    className = props.className,\n    customizePrefixCls = props.prefixCls;\n  var _useContext = useContext(ConfigContext),\n    getPrefixCls = _useContext.getPrefixCls;\n  var prefixCls = getPrefixCls('qrcode', customizePrefixCls);\n  var _useStyle = useStyle(prefixCls),\n    _useStyle2 = _slicedToArray(_useStyle, 2),\n    wrapSSR = _useStyle2[0],\n    hashId = _useStyle2[1];\n  var _useToken = useToken(),\n    token = _useToken.token;\n  var qrCodeProps = useMemo(function () {\n    var imageSettings = {\n      src: icon,\n      x: undefined,\n      y: undefined,\n      height: iconSize,\n      width: iconSize,\n      excavate: true\n    };\n    return {\n      value: value,\n      size: size - (token.paddingSM + token.lineWidth) * 2,\n      level: errorLevel,\n      bgColor: 'transparent',\n      fgColor: color,\n      imageSettings: icon ? imageSettings : undefined\n    };\n  }, [errorLevel, color, icon, iconSize, size, value]);\n  if (!value) {\n    if (process.env.NODE_ENV !== 'production') {\n      process.env.NODE_ENV !== \"production\" ? warning(false, 'QRCode', 'need to receive `value` props') : void 0;\n    }\n    return null;\n  }\n  if (process.env.NODE_ENV !== 'production') {\n    process.env.NODE_ENV !== \"production\" ? warning(!(icon && errorLevel === 'L'), 'QRCode', 'ErrorLevel `L` is not recommended to be used with `icon`, for scanning result would be affected by low level.') : void 0;\n  }\n  var cls = classNames(prefixCls, className, hashId, _defineProperty({}, \"\".concat(prefixCls, \"-borderless\"), !bordered));\n  return wrapSSR( /*#__PURE__*/React.createElement(LocaleReceiver, {\n    componentName: \"QRCode\"\n  }, function (locale) {\n    return /*#__PURE__*/React.createElement(\"div\", {\n      style: Object.assign(Object.assign({}, style), {\n        width: size,\n        height: size\n      }),\n      className: cls\n    }, status !== 'active' && /*#__PURE__*/React.createElement(\"div\", {\n      className: \"\".concat(prefixCls, \"-mask\")\n    }, status === 'loading' && /*#__PURE__*/React.createElement(Spin, null), status === 'expired' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"p\", {\n      className: \"\".concat(prefixCls, \"-expired\")\n    }, locale.expired), typeof onRefresh === 'function' && /*#__PURE__*/React.createElement(Button, {\n      type: \"link\",\n      icon: /*#__PURE__*/React.createElement(ReloadOutlined, null),\n      onClick: onRefresh\n    }, locale.refresh))), /*#__PURE__*/React.createElement(QRCodeCanvas, Object.assign({}, qrCodeProps)));\n  }));\n};\nexport default QRCode;","map":{"version":3,"names":["React","useMemo","useContext","QRCodeCanvas","classNames","ReloadOutlined","ConfigContext","LocaleReceiver","warning","useStyle","Spin","Button","theme","useToken","QRCode","props","value","icon","size","iconSize","color","errorLevel","status","bordered","onRefresh","style","className","customizePrefixCls","prefixCls","getPrefixCls","wrapSSR","hashId","token","qrCodeProps","imageSettings","src","x","undefined","y","height","width","excavate","paddingSM","lineWidth","level","bgColor","fgColor","process","env","NODE_ENV","cls","createElement","componentName","locale","Object","assign","Fragment","expired","type","onClick","refresh"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/qrcode/index.js"],"sourcesContent":["import React, { useMemo, useContext } from 'react';\nimport { QRCodeCanvas } from 'qrcode.react';\nimport classNames from 'classnames';\nimport { ReloadOutlined } from '@ant-design/icons';\nimport { ConfigContext } from '../config-provider';\nimport LocaleReceiver from '../locale/LocaleReceiver';\nimport warning from '../_util/warning';\nimport useStyle from './style/index';\nimport Spin from '../spin';\nimport Button from '../button';\nimport theme from '../theme';\nconst {\n  useToken\n} = theme;\nconst QRCode = props => {\n  const {\n    value,\n    icon = '',\n    size = 160,\n    iconSize = 40,\n    color = '#000',\n    errorLevel = 'M',\n    status = 'active',\n    bordered = true,\n    onRefresh,\n    style,\n    className,\n    prefixCls: customizePrefixCls\n  } = props;\n  const {\n    getPrefixCls\n  } = useContext(ConfigContext);\n  const prefixCls = getPrefixCls('qrcode', customizePrefixCls);\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const {\n    token\n  } = useToken();\n  const qrCodeProps = useMemo(() => {\n    const imageSettings = {\n      src: icon,\n      x: undefined,\n      y: undefined,\n      height: iconSize,\n      width: iconSize,\n      excavate: true\n    };\n    return {\n      value,\n      size: size - (token.paddingSM + token.lineWidth) * 2,\n      level: errorLevel,\n      bgColor: 'transparent',\n      fgColor: color,\n      imageSettings: icon ? imageSettings : undefined\n    };\n  }, [errorLevel, color, icon, iconSize, size, value]);\n  if (!value) {\n    if (process.env.NODE_ENV !== 'production') {\n      process.env.NODE_ENV !== \"production\" ? warning(false, 'QRCode', 'need to receive `value` props') : void 0;\n    }\n    return null;\n  }\n  if (process.env.NODE_ENV !== 'production') {\n    process.env.NODE_ENV !== \"production\" ? warning(!(icon && errorLevel === 'L'), 'QRCode', 'ErrorLevel `L` is not recommended to be used with `icon`, for scanning result would be affected by low level.') : void 0;\n  }\n  const cls = classNames(prefixCls, className, hashId, {\n    [`${prefixCls}-borderless`]: !bordered\n  });\n  return wrapSSR( /*#__PURE__*/React.createElement(LocaleReceiver, {\n    componentName: \"QRCode\"\n  }, locale => /*#__PURE__*/React.createElement(\"div\", {\n    style: Object.assign(Object.assign({}, style), {\n      width: size,\n      height: size\n    }),\n    className: cls\n  }, status !== 'active' && /*#__PURE__*/React.createElement(\"div\", {\n    className: `${prefixCls}-mask`\n  }, status === 'loading' && /*#__PURE__*/React.createElement(Spin, null), status === 'expired' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"p\", {\n    className: `${prefixCls}-expired`\n  }, locale.expired), typeof onRefresh === 'function' && /*#__PURE__*/React.createElement(Button, {\n    type: \"link\",\n    icon: /*#__PURE__*/React.createElement(ReloadOutlined, null),\n    onClick: onRefresh\n  }, locale.refresh))), /*#__PURE__*/React.createElement(QRCodeCanvas, Object.assign({}, qrCodeProps)))));\n};\nexport default QRCode;"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,UAAU,QAAQ,OAAO;AAClD,SAASC,YAAY,QAAQ,cAAc;AAC3C,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,cAAc,MAAM,0BAA0B;AACrD,OAAOC,OAAO,MAAM,kBAAkB;AACtC,OAAOC,QAAQ,MAAM,eAAe;AACpC,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,KAAK,MAAM,UAAU;AAC5B,IACEC,QAAQ,GACND,KAAK,CADPC,QAAQ;AAEV,IAAMC,MAAM,GAAG,SAATA,MAAM,CAAGC,KAAK,EAAI;EACtB,IACEC,KAAK,GAYHD,KAAK,CAZPC,KAAK;IAAA,cA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